﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IPC.Communication.Framework.Profinet.IDCard
{
    public class IdentityCard
    {
        public string Name
        {
            get;
            set;
        }

        public string Sex
        {
            get;
            set;
        }

        public string Id
        {
            get;
            set;
        }

        public string Nation
        {
            get;
            set;
        }

        public DateTime Birthday
        {
            get;
            set;
        }

        public string Address
        {
            get;
            set;
        }

        public string Organ
        {
            get;
            set;
        }

        public DateTime ValidityStartDate
        {
            get;
            set;
        }

        public DateTime ValidityEndDate
        {
            get;
            set;
        }

        public byte[] Portrait
        {
            get;
            set;
        }

        public override string ToString()
        {
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.Append("姓名：" + Name);
            stringBuilder.Append(Environment.NewLine);
            stringBuilder.Append("性别：" + Sex);
            stringBuilder.Append(Environment.NewLine);
            stringBuilder.Append("民族：" + Nation);
            stringBuilder.Append(Environment.NewLine);
            stringBuilder.Append("身份证号：" + Id);
            stringBuilder.Append(Environment.NewLine);
            stringBuilder.Append(String.Format("出身日期：{0}年{1}月{2}日", Birthday.Year, Birthday.Month, Birthday.Day));
            stringBuilder.Append(Environment.NewLine);
            stringBuilder.Append("地址：" + Address);
            stringBuilder.Append(Environment.NewLine);
            stringBuilder.Append("发证机关：" + Organ);
            stringBuilder.Append(Environment.NewLine);
            stringBuilder.Append(String.Format("有效日期：{0}年{1}月{2}日 - {3}年{4}月{5}日", ValidityStartDate.Year, ValidityStartDate.Month, ValidityStartDate.Day, ValidityEndDate.Year, ValidityEndDate.Month, ValidityEndDate.Day));
            stringBuilder.Append(Environment.NewLine);
            return stringBuilder.ToString();
        }
    }
}